package com.ruoyi.iot.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iot.mapper.FacCommonMonitorFieldMapper;
import com.ruoyi.iot.domain.FacCommonMonitorField;
import com.ruoyi.iot.service.IFacCommonMonitorFieldService;

/**
 * 设备监控常见字段Service业务层处理
 * 
 * @author rww
 * @date 2024-06-17
 */
@Service
public class FacCommonMonitorFieldServiceImpl implements IFacCommonMonitorFieldService 
{
    @Autowired
    private FacCommonMonitorFieldMapper facCommonMonitorFieldMapper;

    /**
     * 查询设备监控常见字段
     * 
     * @param id 设备监控常见字段主键
     * @return 设备监控常见字段
     */
    @Override
    public FacCommonMonitorField selectFacCommonMonitorFieldById(Long id)
    {
        return facCommonMonitorFieldMapper.selectFacCommonMonitorFieldById(id);
    }

    /**
     * 查询设备监控常见字段列表
     * 
     * @param facCommonMonitorField 设备监控常见字段
     * @return 设备监控常见字段
     */
    @Override
    public List<FacCommonMonitorField> selectFacCommonMonitorFieldList(FacCommonMonitorField facCommonMonitorField)
    {
        return facCommonMonitorFieldMapper.selectFacCommonMonitorFieldList(facCommonMonitorField);
    }

    /**
     * 新增设备监控常见字段
     * 
     * @param facCommonMonitorField 设备监控常见字段
     * @return 结果
     */
    @Override
    public int insertFacCommonMonitorField(FacCommonMonitorField facCommonMonitorField)
    {
        facCommonMonitorField.setId(IdUtil.getSnowflakeNextId());
        return facCommonMonitorFieldMapper.insertFacCommonMonitorField(facCommonMonitorField);
    }

    /**
     * 修改设备监控常见字段
     * 
     * @param facCommonMonitorField 设备监控常见字段
     * @return 结果
     */
    @Override
    public int updateFacCommonMonitorField(FacCommonMonitorField facCommonMonitorField)
    {
        return facCommonMonitorFieldMapper.updateFacCommonMonitorField(facCommonMonitorField);
    }

    /**
     * 批量删除设备监控常见字段
     * 
     * @param ids 需要删除的设备监控常见字段主键
     * @return 结果
     */
    @Override
    public int deleteFacCommonMonitorFieldByIds(Long[] ids)
    {
        return facCommonMonitorFieldMapper.deleteFacCommonMonitorFieldByIds(ids);
    }

    /**
     * 删除设备监控常见字段信息
     * 
     * @param id 设备监控常见字段主键
     * @return 结果
     */
    @Override
    public int deleteFacCommonMonitorFieldById(Long id)
    {
        return facCommonMonitorFieldMapper.deleteFacCommonMonitorFieldById(id);
    }
}
